<template>
    <div class="">

        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item><i class="el-icon-lx-copy"></i> 添加运单</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <center>        
            <div class="qwe">
                <el-input v-model="sign" placeholder="请填写发货单号"></el-input>
                <el-select v-model="customer" placeholder="请选择客户">
                    <el-option
                    v-for="item in UserList"
                    :key="item.value"
                    :label="item.name"
                    :value="item.id">
                    </el-option>
                </el-select>
                <el-button type="primary" @click="submitForm()">添加</el-button>

            </div>
        </center>
    </div>
</template>

<script>
import {AddSign,ShowCustomer} from '../../api/api.js'
    export default {
        inject:['reload'],
        name: 'company',
        data() {
            return {
                sign:"",
                UserList:[],
                uid:localStorage.getItem('uid'),
                customer:"",

            }
        },
        methods: {
            submitForm(){
               let params = {
                    consignment:this.sign,
                    customer:this.customer,
                    
                } 
                AddSign(params).then(res=>{
                    if(res.data.code == 200){
                        this.$message(res.data.message)
                        this.reload()
                    }else{
                        this.$message(res.data.message)
                    }
                })
            },
        },
        computed: {
            
        },
        mounted(){
            ShowCustomer().then(res=>{
                this.UserList = res.data
            })
        }
    }

</script>

<style>
.qwe{
    width: 16%;
    padding: "50%";
    text-align: center;

}
</style>


